<div class="container">
    <legend><h3>管理员信息</h3></legend>
    <a href="add.php" class="btn btn-default" type="button">添加管理员</a>
    <table class="table table-bordered">
        <tr class="th">
            <td>序号</td>
            <td widtd="15%">用户名</td>
            <td widtd="20%">身份</td>
            <td widtd="35%">联系方式</td>
            <td widtd="15%">删除管理员</td>
            <td widtd="15%">重置密码</td>
        </tr>
        <?php
        $manage = new MANAGE();
        $record = $manage->list_manager();
        ?>
        <?php foreach ($record as $key => $value): ?>
            <tr>
                <td><?php echo htmlspecialchars($key + 1); ?></td>
                <td><?php echo htmlspecialchars($value['name']); ?></td>
                <td><?php echo htmlspecialchars($value['duty']); ?></td>
                <td><?php echo htmlspecialchars($value['number']); ?></td>
                <td>
                    <form action='../php/manager.php?action=del' method='POST'>
                        <input name = 'name' type='hidden' value="<?php echo htmlspecialchars($value['name']); ?>">
                        <button class='btn btn-danger' type='submit'>删除</button>
                    </form>
                </td>
                <td>
                        <button class='btn btn-primary reset_button' data-toggle='modal' data-target='#myModal'>重置密码</button>
                        <input name = 'name' type='hidden' value="<?php echo htmlspecialchars($value['name']); ?>">
                </td>
            </tr>
        <?php endforeach; ?>
    </table>
</div>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">重置密码</h4>
      </div>
      <div class="modal-body">
        <form role = "form" action = "../php/manager.php?action=reset" method="POST">
            <input type="hidden" id="username" class="form-control" name="name">
            <div class="form-group">
                <label for="example2">密码</label>
                <input type="password" class="form-control" id="example2" placeholder="密码" name="password">
            </div>
            <div class="form-group">
                <label for="config">确认密码</label>
                <input type="password" class="form-control" id="config" placeholder="确认密码" name="configure">
            </div>
            <button type="submit" class="btn btn-primary">提交</button>
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </form>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
